sep = ";", stringsAsFactors = F)
ICCs <- ICCs %>%
filter(nobs >= 300) # Drops 13
# Random effects
RE <- read.csv("20200108_RE.csv", dec = ".",
sep = ";", stringsAsFactors = F)
# Interviewers
interviewers <- read.csv("20200108_interviewers.csv" , dec = ".",
sep = ";", stringsAsFactors = F)
# Cumulative interview time measures
speed <- read.csv("speedindicators.ICum.csv" , dec = ".",
sep = ";", stringsAsFactors = F)
RE_cum <- merge(merge(RE, interviewers[c("essround", "cntry", "intnum", "INTNUM_FW", "iWL")],
by = c("essround", "cntry", "intnum")),
speed, by = c("essround", "cntry", "intnum"), all.x = T)
# Spread by round
ICCs_itembyround <- ICCs %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, item, icc_fit_controls, label) %>%
spread(key = essround, value = icc_fit_controls)
# Number of items
nitems_R6 <- with(ICCs_itembyround, sum(!is.na(ESS6_BEDUT)))
nitems_R7 <- with(ICCs_itembyround, sum(!is.na(ESS7_BEDUT)))
nitems_R6R7 <- with(ICCs_itembyround, sum(!is.na(ESS6_BEDUT) & !is.na(ESS7_BEDUT)))
# Subset items significant and ICC > 1%
ICCs_selected <- ICCs %>%
filter(LRtest_pvalue < .05)   # icc_fit_controls > .01 &
# Spread by round
ICCs_selected_itembyround <- ICCs_selected %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, item, icc_fit_controls, label) %>%
spread(key = essround, value = icc_fit_controls)
# Number of items
nitems_selected_R6 <- with(ICCs_selected_itembyround, sum(!is.na(ESS6_BEDUT)))
nitems_selected_R7 <- with(ICCs_selected_itembyround, sum(!is.na(ESS7_BEDUT)))
nitems_selected_R6R7 <- with(ICCs_selected_itembyround, sum(!is.na(ESS6_BEDUT) & !is.na(ESS7_BEDUT)))
ICCs_cor <- with(ICCs_itembyround, cor.test(ESS6_BEDUT, ESS7_BEDUT, use = "complete.cases"))
ICCs_selected_cor <- with(ICCs_selected_itembyround, cor.test(ESS6_BEDUT, ESS7_BEDUT, use = "complete.cases"))
p1 <- ggplot(ICCs %>%
mutate(icc_fit_controls_mean = ave(icc_fit_controls, item, FUN = mean),
both_rounds = ave(icc_fit_controls, item, FUN = length) == 2) %>%
arrange(icc_fit_controls_mean) %>%
mutate(essround = as.factor(paste0("ESS", essround, "_BEDUT")),
item = factor(as.factor(item), levels = unique(item)),
panel = ifelse(as.numeric(item) > mean(as.numeric(item)), 1, 2)),
aes(x = icc_fit_controls, y = item, col = essround, shape = essround, alpha = both_rounds)) +
geom_point() +
scale_x_continuous(name = "Intra-interviewer correlation", limits = c(0, NA), breaks = seq(0, .1, .01)) +
scale_colour_manual(values = c("ESS6_BEDUT" = ESSpink, "ESS7_BEDUT" = KULgold)) +
scale_shape_manual(values = c("ESS6_BEDUT" = 15, "ESS7_BEDUT" = 19)) +
scale_alpha_manual(values = c("TRUE" = 1, "FALSE" = .33), guide = F) +
facet_wrap(. ~ panel, scales = "free_y") +
themeKUL +
theme(axis.ticks.y = element_blank(),
axis.title.y = element_blank(),
axis.line.x = element_line(),
strip.text = element_blank(),
legend.position = "bottom",
legend.direction = "vertical")
p1
overviewtable <- ICCs_selected_itembyround %>%
mutate(icc_fit_controls_mean = rowMeans(cbind(ESS6_BEDUT, ESS7_BEDUT), na.rm = T)) %>%
arrange(-icc_fit_controls_mean) %>%
dplyr::select(item, label, ESS6_BEDUT, ESS7_BEDUT) %>%
mutate(label = gsub("/", ", ", label))
kable(overviewtable,
row.names = F,
booktabs = T,
longtable = T,
escape = T,
digits = 3,
col.names = c("Name",
"Label",
"ESS6 BEDUT",
"ESS7 BEDUT"),
align = c(rep("l", 2), rep("r", 2)),
caption = paste("\\label{tab:iccoverview} Intra-interviewer correlations for selected survey items")) %>%
column_spec(c(1, 3:4), width = "1.5cm") %>%
column_spec(2, width = "8cm") %>%
add_header_above(c(" " = 2, "Intra-interviewer correlation" = 2)) %>%
kable_styling(latex_options = c("HOLD_position", "repeat_header"))
stargazer(ICCs_itembyround[c("ESS6_BEDUT", "ESS7_BEDUT")],
header = F,
median = T, iqr = T,
title = "Descriptives of intra-interviewer correlations (all survey items)")
fits
knitr::opts_chunk$set(echo = FALSE, error = FALSE, warning = FALSE, message = FALSE,
fig.width = 7, fig.height = 10)
library(tidyverse)
library(ggthemes)
library(cowplot)
library(colortools)
library(kableExtra)
library(stargazer)
library(formattable)
library(lme4)
#library(lmerTest) # detach("package:lmerTest")
library(merTools)
library(sjstats)
library(broom)
library(reghelper)
options(knitr.table.format = "latex", knitr.kable.NA = '.')
KULgold <- rgb(231, 176, 55, maxColorValue = 255)
ESSpink <- rgb(232, 51, 176, maxColorValue = 255)
KULgreen <- rgb(212, 216, 66, maxColorValue = 255)
Colorvec <- c(KULgold, ESSpink, KULgreen)
PSize_portrait <- c(160, 210)
themeKUL <- theme_tufte(base_size = 9) + # base_family = "Calibri"
theme(axis.title = element_text(size = 9, face = "plain"),
axis.text = element_text(size = 9),
axis.line.x = element_line(),
plot.title = element_blank(),
legend.title = element_blank(),
legend.text = element_text(size = 9),
strip.text = element_text(size = 9, face = "bold"),
legend.position = "bottom",
legend.direction = "horizontal",
legend.box = "vertical",
legend.spacing = unit(0, "line"),
legend.key.size = unit(.75, "line"))
# Sample figures
analyticsample <- read.csv("20200108_sample.csv", dec = ".",
sep = ";", stringsAsFactors = F)
# ICCs
ICCs <- read.csv("20200108_ICCs.csv", dec = ".",
sep = ";", stringsAsFactors = F)
ICCs <- ICCs %>%
filter(nobs >= 300) # Drops 13
# Random effects
RE <- read.csv("20200108_RE.csv", dec = ".",
sep = ";", stringsAsFactors = F)
# Interviewers
interviewers <- read.csv("20200108_interviewers.csv" , dec = ".",
sep = ";", stringsAsFactors = F)
# Cumulative interview time measures
speed <- read.csv("speedindicators.ICum.csv" , dec = ".",
sep = ";", stringsAsFactors = F)
RE_cum <- merge(merge(RE, interviewers[c("essround", "cntry", "intnum", "INTNUM_FW", "iWL")],
by = c("essround", "cntry", "intnum")),
speed, by = c("essround", "cntry", "intnum"), all.x = T)
# Spread by round
ICCs_itembyround <- ICCs %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, item, icc_fit_controls, label) %>%
spread(key = essround, value = icc_fit_controls)
# Number of items
nitems_R6 <- with(ICCs_itembyround, sum(!is.na(ESS6_BEDUT)))
nitems_R7 <- with(ICCs_itembyround, sum(!is.na(ESS7_BEDUT)))
nitems_R6R7 <- with(ICCs_itembyround, sum(!is.na(ESS6_BEDUT) & !is.na(ESS7_BEDUT)))
# Subset items significant and ICC > 1%
ICCs_selected <- ICCs %>%
filter(LRtest_pvalue < .05)   # icc_fit_controls > .01 &
# Spread by round
ICCs_selected_itembyround <- ICCs_selected %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, item, icc_fit_controls, label) %>%
spread(key = essround, value = icc_fit_controls)
# Number of items
nitems_selected_R6 <- with(ICCs_selected_itembyround, sum(!is.na(ESS6_BEDUT)))
nitems_selected_R7 <- with(ICCs_selected_itembyround, sum(!is.na(ESS7_BEDUT)))
nitems_selected_R6R7 <- with(ICCs_selected_itembyround, sum(!is.na(ESS6_BEDUT) & !is.na(ESS7_BEDUT)))
ICCs_cor <- with(ICCs_itembyround, cor.test(ESS6_BEDUT, ESS7_BEDUT, use = "complete.cases"))
ICCs_selected_cor <- with(ICCs_selected_itembyround, cor.test(ESS6_BEDUT, ESS7_BEDUT, use = "complete.cases"))
p1 <- ggplot(ICCs %>%
mutate(icc_fit_controls_mean = ave(icc_fit_controls, item, FUN = mean),
both_rounds = ave(icc_fit_controls, item, FUN = length) == 2) %>%
arrange(icc_fit_controls_mean) %>%
mutate(essround = as.factor(paste0("ESS", essround, "_BEDUT")),
item = factor(as.factor(item), levels = unique(item)),
panel = ifelse(as.numeric(item) > mean(as.numeric(item)), 1, 2)),
aes(x = icc_fit_controls, y = item, col = essround, shape = essround, alpha = both_rounds)) +
geom_point() +
scale_x_continuous(name = "Intra-interviewer correlation", limits = c(0, NA), breaks = seq(0, .1, .01)) +
scale_colour_manual(values = c("ESS6_BEDUT" = ESSpink, "ESS7_BEDUT" = KULgold)) +
scale_shape_manual(values = c("ESS6_BEDUT" = 15, "ESS7_BEDUT" = 19)) +
scale_alpha_manual(values = c("TRUE" = 1, "FALSE" = .33), guide = F) +
facet_wrap(. ~ panel, scales = "free_y") +
themeKUL +
theme(axis.ticks.y = element_blank(),
axis.title.y = element_blank(),
axis.line.x = element_line(),
strip.text = element_blank(),
legend.position = "bottom",
legend.direction = "vertical")
p1
overviewtable <- ICCs_selected_itembyround %>%
mutate(icc_fit_controls_mean = rowMeans(cbind(ESS6_BEDUT, ESS7_BEDUT), na.rm = T)) %>%
arrange(-icc_fit_controls_mean) %>%
dplyr::select(item, label, ESS6_BEDUT, ESS7_BEDUT) %>%
mutate(label = gsub("/", ", ", label))
kable(overviewtable,
row.names = F,
booktabs = T,
longtable = T,
escape = T,
digits = 3,
col.names = c("Name",
"Label",
"ESS6 BEDUT",
"ESS7 BEDUT"),
align = c(rep("l", 2), rep("r", 2)),
caption = paste("\\label{tab:iccoverview} Intra-interviewer correlations for selected survey items")) %>%
column_spec(c(1, 3:4), width = "1.5cm") %>%
column_spec(2, width = "8cm") %>%
add_header_above(c(" " = 2, "Intra-interviewer correlation" = 2)) %>%
kable_styling(latex_options = c("HOLD_position", "repeat_header"))
stargazer(ICCs_itembyround[c("ESS6_BEDUT", "ESS7_BEDUT")],
header = F,
median = T, iqr = T,
title = "Descriptives of intra-interviewer correlations (all survey items)")
stargazer(ICCs_selected_itembyround[c("ESS6_BEDUT", "ESS7_BEDUT")],
header = F,
median = T, iqr = T,
title = "Descriptives of intra-interviewer correlations (selected survey items)")
interviewers <- interviewers %>%
mutate(AUDIO_READING = ((AUDIO_ALL == 2) +
(AUDIO_ALLQSAME == 2) +
(AUDIO_ALLREAD == 2) +
(AUDIO_CLEAR == 2) +
(AUDIO_COMPLETE == 2) +
(AUDIO_NOEXTRA == 2)),
AUDIO_SUGGESTIVE = ((AUDIO_NOEXAMPLE == 2) +
(AUDIO_NOJUDGEMENT == 2) +
(AUDIO_NOOPINION == 2) +
(AUDIO_NOTINOPTIONS == 2) +
(AUDIO_QREPEAT == 2) +
(AUDIO_NOTSUGGESTIVE == 2) +
(AUDIO_RESPINTERPRET == 2)),
AUDIO_RUSHING = ((AUDIO_TEMPO == 2) +
(AUDIO_ENOUGHTIME == 2)),
AUDIO_MINOR = AUDIO_NDEV - AUDIO_READING - AUDIO_SUGGESTIVE - AUDIO_RUSHING,
AUDIO_READINGCAT = ifelse(AUDIO_READING > 0, 1, 0),
AUDIO_SUGGESTIVECAT = ifelse(AUDIO_SUGGESTIVE > 0, 1, 0),
AUDIO_RUSHINGCAT = ifelse(AUDIO_RUSHING > 0, 1, 0),
AUDIO_MINORCAT = ifelse(AUDIO_MINOR > 0, 1, 0))
# Note: RE already only contains the selected items
RE <- left_join(RE, interviewers)
RE <- left_join(RE, ICCs[c("essround", "cntry", "item", "icc_fit_controls")])
p2 <- ggplot(RE %>%
mutate(abs_condval_mean = ave(abs_condval, INTNUM_FW, FUN = mean)) %>%
arrange(abs_condval_mean) %>%
mutate(essround = as.factor(paste0("ESS", essround, "_BEDUT")),
INTNUM_FW = factor(as.factor(INTNUM_FW), levels = unique(INTNUM_FW)),
abs_condval = ifelse(abs_condval > .5, .5, abs_condval)),
aes(x = abs_condval, y = INTNUM_FW, col = essround, shape = essround)) +
geom_point(alpha = .25, col = "black") +
scale_x_continuous(name = "Estimated absolute difference between interviewer-specific intercept and
overall intercept", limits = c(0, .51), breaks = seq(0, .5, .05)) +
scale_shape_manual(values = c("ESS6_BEDUT" = 2, "ESS7_BEDUT" = 3)) +
#scale_shape_manual(values = c("ESS6_BEDUT" = 15, "ESS7_BEDUT" = 19)) +
geom_point(inherit.aes = F, aes(x = abs_condval_mean, y = INTNUM_FW), shape = 8, size = 1, col = "black") +
themeKUL +
theme(axis.ticks.y = element_blank(),
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.line.x = element_line(),
strip.text = element_blank(),
legend.position = "bottom",
legend.direction = "vertical") +
guides(colour = guide_legend(override.aes = list(alpha = .5)),
shape = guide_legend(override.aes = list(alpha = .5)))
p2
RE_byinterviewer <- aggregate(abs_condval ~ INTNUM_FW + essround, FUN = mean,  data = RE)
RE_byinterviewer <- left_join(RE_byinterviewer, interviewers, by = c("INTNUM_FW", "essround"))
with(RE_byinterviewer, summary(abs_condval)); with(RE_byinterviewer, quantile(abs_condval, seq(0, 1, .05)))
with(RE_byinterviewer, cor.test(abs_condval, iWL))
# Spread to byround
audioscore_byround <- interviewers %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, INTNUM_FW, AUDIO_NDEV) %>%
spread(key = essround, value = AUDIO_NDEV)
speed_byround <- interviewers %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, INTNUM_FW, speed_mainexclF.mean) %>%
spread(key = essround, value = speed_mainexclF.mean)
speedtrend_byround <- interviewers %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, INTNUM_FW, speedTrend.mean) %>%
spread(key = essround, value = speedTrend.mean)
# Audio checks frequencies
audiochecks_freq <- read.csv("20200108_audiochecks_freq.csv", dec = ".",
sep = ";", stringsAsFactors = F)
audiovarlabels <- read.csv("var_audio labels.csv", dec = ".",
sep = ";", stringsAsFactors = F)
audiovarlabels <- audiovarlabels%>%
mutate(checkorder = 1:nrow(audiovarlabels))
audiochecks_freq_checksbyround <- audiochecks_freq %>%
mutate(essround = paste0("ESS", essround, "_BEDUT")) %>%
dplyr::select(essround, variable, label, prop) %>%
spread(key = essround, value = prop)
audiochecks_freq_checksbyround <- left_join(audiochecks_freq_checksbyround, audiovarlabels) %>%
arrange(checkorder)
audio_cor <- with(audioscore_byround, cor.test(ESS6_BEDUT, ESS7_BEDUT, use = "complete.cases"))
speed_cor <- with(speed_byround, cor.test(ESS6_BEDUT, ESS7_BEDUT, use = "complete.cases"))
speedtrend_cor <- with(speedtrend_byround, cor.test(ESS6_BEDUT, ESS7_BEDUT, use = "complete.cases"))
audiotable <- audiochecks_freq_checksbyround %>%
dplyr::select(label, ESS6_BEDUT, ESS7_BEDUT)
kable(audiotable %>%
mutate_at(c("ESS6_BEDUT", "ESS7_BEDUT"), function(x) formattable::percent(x, digits = 1)),
row.names = F,
booktabs = T,
digits = 1,
col.names = c("Check",
"ESS6 BEDUT",
"ESS7 BEDUT"),
align = c("l", rep("r", 2)),
caption = paste("\\label{tab:audio_freq} Checklist of standardized interviewing protocol")) %>%
column_spec(1, width = "10cm") %>%
column_spec(2:3, width = "2.5cm") %>%
kable_styling(latex_options = c("hold_position")) %>%
add_header_above(c(" " = 1, "Deviation from check" = 2), escape = F)
p3 <- ggplot(data = interviewers %>%
mutate(essround = as.factor(paste0("ESS", essround, "_BEDUT"))),
aes(x = AUDIO_NDEV)) +
geom_bar(alpha = .5, col = NA, fill = "grey", width = 0.75) +
geom_hline(yintercept = c(5, 10, 15), colour = 'white', width = 0.25) +
scale_x_continuous(name = "Standardized interviewing deviation score",
breaks = seq(0, 30, 1)) +
facet_wrap(facets = "essround") +
themeKUL +
theme(axis.ticks.y = element_blank(),
axis.title.y = element_blank(),
axis.line.x = element_line(),
legend.position = "none")
p3
p4 <- ggplot(data = subset(audioscore_byround, complete.cases(audioscore_byround)),
aes(x = ESS6_BEDUT, y = ESS7_BEDUT)) +
geom_point(size = 2, shape = 21, alpha = .2, fill = "black", col = "white") +
scale_x_continuous(name = "Standardized interviewing deviation score, ESS6_BEDUT",
limits = c(-1, 15), breaks = seq(0, 15, 1)) +
scale_y_continuous(name = "Standardized interviewing deviation score, ESS7_BEDUT",
limits = c(-1, 15), breaks = seq(0, 15, 1)) +
themeKUL +
theme(axis.line.x = element_line(),
axis.line.y = element_line())
xplot <- ggplot(subset(audioscore_byround, complete.cases(audioscore_byround)),
aes(x = ESS6_BEDUT)) +
geom_histogram(fill = ESSpink, col = "white", alpha = .5, binwidth = 1) +
scale_x_continuous(limits = c(-1, 15)) +
themeKUL +
theme(axis.line = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
axis.text = element_blank())
yplot <- ggplot(subset(audioscore_byround, complete.cases(audioscore_byround)),
aes(x = ESS7_BEDUT)) +
geom_histogram(fill = KULgold, col = "white", alpha = .5, binwidth = 1) +
scale_x_continuous(limits = c(-1, 15)) +
themeKUL +
theme(axis.line = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
axis.text = element_blank()) +
coord_flip()
p4 <- plot_grid(xplot, NULL, p4, yplot, ncol = 2, align = "hv",
rel_widths = c(3, 1), rel_heights = c(1, 3))
p4
stargazer(audioscore_byround[c("ESS6_BEDUT", "ESS7_BEDUT")],
header = F,
title = "Descriptives of standardized interviewing deviation score")
p4 <- ggplot(data = subset(speed_byround, complete.cases(speed_byround)),
aes(x = ESS6_BEDUT, y = ESS7_BEDUT)) +
geom_point(size = 2, shape = 21, alpha = .2, fill = "black", col = "white") +
scale_x_continuous(name = "Average interview speed, ESS6_BEDUT",
limits = c(0, 6), breaks = seq(0, 6, 1)) +
scale_y_continuous(name = "Average interview speed, ESS7_BEDUT",
limits = c(0, 6), breaks = seq(0, 6, 1)) +
themeKUL +
theme(axis.line.x = element_line(),
axis.line.y = element_line())
xplot <- ggplot(subset(speed_byround, complete.cases(speed_byround)),
aes(x = ESS6_BEDUT)) +
geom_histogram(fill = ESSpink, col = "white", alpha = .5, binwidth = .5) +
scale_x_continuous(limits = c(0, 6)) +
themeKUL +
theme(axis.line = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
axis.text = element_blank())
yplot <- ggplot(subset(speed_byround, complete.cases(speed_byround)),
aes(x = ESS7_BEDUT)) +
geom_histogram(fill = KULgold, col = "white", alpha = .5, binwidth = .5) +
scale_x_continuous(limits = c(0, 6)) +
themeKUL +
theme(axis.line = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
axis.text = element_blank()) +
coord_flip()
p4 <- plot_grid(xplot, NULL, p4, yplot, ncol = 2, align = "hv",
rel_widths = c(3, 1), rel_heights = c(1, 3))
p4
stargazer(speed_byround[c("ESS6_BEDUT", "ESS7_BEDUT")],
header = F,
title = "Descriptives of average interview speed")
stargazer(speedtrend_byround[c("ESS6_BEDUT", "ESS7_BEDUT")],
header = F,
title = "Descriptives of average interview acceleration over the questionnaire")
subset(interviewers, intnum %in% c(111166, 111247, 112734))
p5 <- ggplot(data = subset(speed, intnum %in% c(111166, 111247, 112734)) %>%
mutate(intnum = as.factor(intnum)),
aes(x = intervieworder, y = speed_mainexclF.mean, linetype = intnum)) +
geom_line() +
scale_x_continuous(name = "Number of completed interviews",
limits = c(0, 20),
breaks = 0:20,
labels = c(0:10, rep("", 4), 15, rep("", 4), 20)) +
scale_y_continuous(name = "Average interview speed", limits = c(2, NA), breaks = seq(0, 5, .5)) +
scale_linetype_manual(values = c("111166" = "dashed",
"111247" = "solid",
"112734" = "dotted"),
labels = c("111166" = "Interviewer 1",
"111247" = "Interviewer 2",
"112734" = "Interviewer 3")) +
themeKUL +
theme(axis.line = element_line(),
legend.direction = "vertical")
p6 <- ggplot(data = subset(speed, intnum %in% c(111166, 111247, 112734)) %>%
mutate(intnum = as.factor(intnum)),
aes(x = intervieworder, y = speedTrend.mean, linetype = intnum)) +
geom_line() +
scale_x_continuous(name = "Number of completed interviews",
limits = c(0, 20),
breaks = 0:20,
labels = c(0:10, rep("", 4), 15, rep("", 4), 20)) +
scale_y_continuous(name = "Average acceleration over questionnaire", breaks = seq(-.5, .5, .25)) +
scale_linetype_manual(values = c("111166" = "dashed",
"111247" = "solid",
"112734" = "dotted"),
labels = c("111166" = "Interviewer 1",
"111247" = "Interviewer 2",
"112734" = "Interviewer 3")) +
themeKUL +
theme(axis.line = element_line(),
legend.direction = "vertical")
# Model 0
spec_0 <- "abs_condval ~ essround + iWL + (1|item) + (1|INTNUM_FW)"
fit_0 <- lmer(spec_0, data = RE, na.action = na.exclude)
fit_00 <- update(fit_0, . ~ . - iWL)
# Model A and A'
fit_audio <- update(fit_0, . ~ . + AUDIO_NDEV)
fit_audioalt <- update(fit_0, . ~ . + AUDIO_READINGCAT + AUDIO_SUGGESTIVECAT + AUDIO_RUSHINGCAT)
# Model B and B'
fit_speed <- update(fit_0, . ~ . + speed_mainexclF.mean + speedTrend.mean)
fit_speedtrend <- update(fit_0, . ~ . + speedTrend.mean)
# Model C and C'
fit_final <- update(fit_0, . ~ . + AUDIO_NDEV + speed_mainexclF.mean + speedTrend.mean)
fit_finalalt <- update(fit_0, . ~ . + AUDIO_READINGCAT + AUDIO_SUGGESTIVECAT + AUDIO_RUSHINGCAT + speed_mainexclF.mean + speedTrend.mean)
# # Additional interaction term tests
# fit_speed_quadratic <- update(fit_audio, . ~ . + I(speed_mainexclF.mean^2) + I(speedTrend.mean^2))
# fit_audio_interact <- update(fit_0, . ~ . + AUDIO_NDEV*iWL + AUDIO_NDEV*icc_fit_controls)
# fit_speed_interact <- update(fit_0, . ~ . + speed_mainexclF.mean*iWL + speedTrend.mean*iWL +
#                       speed_mainexclF.mean*icc_fit_controls + speedTrend.mean*icc_fit_controls)
# Excluding workload
fit_audio2 <- update(fit_00, . ~ . + AUDIO_NDEV)
fit_audioalt2 <- update(fit_00, . ~ . + AUDIO_READINGCAT + AUDIO_SUGGESTIVECAT + AUDIO_RUSHINGCAT)
fit_speed2 <- update(fit_00, . ~ . + speed_mainexclF.mean + speedTrend.mean)
fit_speedtrend2 <- update(fit_00, . ~ . + speedTrend.mean)
fit_final2 <- update(fit_00, . ~ . + AUDIO_NDEV + speed_mainexclF.mean + speedTrend.mean)
fit_finalalt2 <- update(fit_00, . ~ . + AUDIO_READINGCAT + AUDIO_SUGGESTIVECAT + AUDIO_RUSHINGCAT + speed_mainexclF.mean + speedTrend.mean)
# Add workload interaction
fit_audio3 <- update(fit_0, . ~ . + iWL*AUDIO_NDEV)
fit_speed3 <- update(fit_0, . ~ . + iWL*speed_mainexclF.mean + iWL*speedTrend.mean)
fit_speedtrend3 <- update(fit_0, . ~ . + iWL*speedTrend.mean)
fit_final3 <- update(fit_0, . ~ . + iWL*AUDIO_NDEV + iWL*speed_mainexclF.mean + iWL*speedTrend.mean)
fit_finalalt3 <- update(fit_0, . ~ . + iWL*AUDIO_READINGCAT + iWL*AUDIO_SUGGESTIVECAT + iWL*AUDIO_RUSHINGCAT + iWL*speed_mainexclF.mean + iWL*speedTrend.mean)
# List of model fits
fits <- list("fit_00" = fit_00, "fit_0" = fit_0,
"fit_audio" = fit_audio, "fit_audioalt" = fit_audioalt,
"fit_speed" = fit_speed,
"fit_final" = fit_final, "fit_finalalt" = fit_finalalt)
fits_std <- lapply(fits, ~ getME(., "beta"))
fits_std <- lapply(fits, ~ getME(., "fixef"))
fits_std <- lapply(fits, function(f) getME(f, "beta"))
# List of model fits
fits <- list("fit_00" = fit_00, "fit_0" = fit_0,
"fit_audio" = fit_audio, "fit_audioalt" = fit_audioalt,
"fit_speed" = fit_speed,
"fit_final" = fit_final, "fit_finalalt" = fit_finalalt)
fits_std <- lapply(fits, function(f) getME(f, "beta"))
fits_estimates <- purrr::map_df(fits, tidy, .id = "model")
fits_stdestimates <- purrr::map_df(fits_std, function(fit) tidy(coef(fit)), .id = "model")
fits_modelfit <- purrr::map_df(fits, function(fit) broom::glance(refitML(fit)), .id = "model")
temp <- fits_std
temp
temp <- temp$fit_00
tidy(coef(temp))
coef(temp)
str(temp)
fits_std <- lapply(fits, beta)
fits_stdestimates <- purrr::map_df(fits, function(f) tidy(coef(f)), .id = "model")
fits_stdestimates <- purrr::map_df(fits, function(f) getME(f, "beta"), .id = "model")
fits_stdestimates <- purrr::map_df(fits, function(f) tidy(coef(f)), .id = "model")
library(reghelper)
fits_std <- lapply(fits, beta)
fits_stdestimates <- purrr::map_df(fits, function(f) tidy(coef(f)), .id = "model")
fits_estimates <- purrr::map_df(fits, tidy, .id = "model")
fits_estimates
temp
temp <- fits[1]
tidy(temp)
temp
tidy(temp)
temp<-temp$fot_00
temp
temp <- fits$fit_00
tidy(temp)
temp
getME(temp, "beta")
beta(temp)
reghelper
library(reghelper)
